package com.cjb.cloudhdfs.controller;

import com.cjb.cloudhdfs.api.HadoopUtil;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @Author chenjinbin
 * @Package IntelliJ IDEA
 * @Class HadoopController
 * @Date 2023-10-20 下午6:45
 */
@RestController
@RequestMapping(value = "hadoop")
@AllArgsConstructor
public class HadoopController {

    private final HadoopUtil hadoopUtil;
    @GetMapping("test")
    public String test(MultipartFile file,String dir) throws Exception {
        hadoopUtil.uploadFile(file.getBytes(),dir);
        return "連同";
    }

    @GetMapping("read")
    public String read(){
        return "read";
    }
}
